/**
 * Created with IntelliJ IDEA.
 * Description:
 */
public class Demo2 {
    public static void main(String[] args) {
        Thread thread1 = new Thread("t1") {
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getId());
                //System.out.println(thread1.getId());  //error
                System.out.println(Thread.currentThread().getName());
                System.out.println(Thread.currentThread().getPriority());
            }
        };

        Thread thread2 = new Thread(() -> {
                System.out.println(Thread.currentThread().getId());
                // System.out.println(thread2.getId());  //error
            System.out.println(Thread.currentThread().getName());
            System.out.println(Thread.currentThread().getPriority());
        }, "t2");
        thread1.start();
        thread2.start();
    }
}
